#include <boost/algorithm/string.hpp>
#include "FromCond.h"

using namespace kc_sf;

// ------------------------------------------------------------- //

FromCond::FromCond( const std::string &localpart, const std::string &domain )
: c_localpart( localpart ),
  c_domain( domain )
{
}

// ------------------------------------------------------------- //

Logic::Symbol * FromCond::clone() const
{
	return new FromCond( *this );
}

// ------------------------------------------------------------- //

bool FromCond::eval( const Message &msg )
{
	return boost::iequals( msg.mFrom.aLocalpart, c_localpart )
		&& boost::iequals( msg.mFrom.aDomain, c_domain );
}


